package com.youkeda.comment.util;

import com.youkeda.comment.dataobject.UserDO;
import com.youkeda.comment.model.User;

public class UserDOUtil {

    /**
     * 模型转换为 DO 对象
     *
     * @param user
     * @return
     */
    public static UserDO toDO(User user) {
        UserDO userDO = new UserDO();
        userDO.setId(user.getId());
        userDO.setUserName(user.getUserName());
        userDO.setNickName(user.getNickName());
        userDO.setAvatar(user.getAvatar());
        userDO.setGmtCreated(user.getGmtCreated());
        userDO.setGmtModified(user.getGmtModified());
        return userDO;
    }
}
